/*
 * @Author: 徐建辰
 * @Date: 2021-11-23 14:29:45
 * @LastEditTime: 2021-11-23 15:30:57
 * @LastEditors: Please set LastEditors
 * @Description: 开发阶段配置
 */
const path = require('path')
const webpack = require('webpack')
const {merge} = require('webpack-merge')
const env = require('../env/dev.env')
const baseWebpackConfig = require('./webpack.base')

module.exports = merge(baseWebpackConfig, {
  mode: 'development',
  target: 'web',
  plugins: [
    new webpack.DefinePlugin({
      "process.env": env,
    })
  ],
  devServer: {
    hot: true, //热更新
    open: true, //编译完自动打开浏览器
    compress: true, //开启gzip压缩
    port: 8088, //开启端口号
    //托管的静态资源文件
    //可通过数组的方式托管多个静态资源文件
    static: {
      directory: path.join(__dirname, "../public"),
    },
    client: {
      //在浏览器端打印编译进度
      progress: true,
    },
  }
})

